from const import lua_proto_path


def genLuafile(protos,maxId):
    fileContent = ""
    fileContent += (
    'MessageId = {'
    '\n'
    )

    for index in range(len(protos)):
        fileContent += "    "
        fileContent += protos[index] 
        fileContent += " = "
        fileContent += str(maxId + index)
        fileContent += ','

    fileContent += ("\n}")

    fo = open(lua_proto_path, "wb")
    fo.write(fileContent.encode('utf-8'))
    fo.close()


